package com.ryskoo.catering.producttemplateattrvalue.service;

import com.ryskoo.catering.producttemplateattrvalue.domain.ProductTemplateAttrValuePO;
import com.ryskoo.catering.producttemplateattrvalue.repository.IProductTemplateAttrValueRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
@Transactional
public class ProductTemplateAttrValueServiceImpl extends BasicServiceImpl<ProductTemplateAttrValuePO> implements IProductTemplateAttrValueService{

    @Autowired
    private IProductTemplateAttrValueRepository productTemplateAttrValueRepository;
    @PostConstruct
    public void init(){
        this.setDao(productTemplateAttrValueRepository);
    }

    @Override
    public void deleteByAttrId(String attrId) {
        productTemplateAttrValueRepository.deleteByAttrId(attrId);
    }

    @Override
    public void deleteByAttrUuids(List<String> idList) {
        productTemplateAttrValueRepository.deleteByAttrUuids(idList);
    }
}
